# -*- coding: utf-8 -*-
# @Time : 2024/1/25 10:05 PM 
# @Author : Wayne
# @Email : 1
# @File : money_decimal.py
# @Project : young_python_demo
# @DESCRIPTION :

"""

add 加  减法
multiply 乘法  divide
python 3.0的直接 + - * /
"""

from decimal import Decimal
order_qty = 1.2
print(Decimal(str(order_qty)))

def add_method(num1, num2):
    num1 = Decimal(str(num1))
    num2 = Decimal(str(num2))
    return num1 + num2

def sub_method(num1, num2):
    num1 = Decimal(str(num1))
    num2 = Decimal(str(num2))
    return num1 - num2

def div_method(num1, num2):
    num1 = Decimal(str(num1))
    num2 = Decimal(str(num2))
    return num1/num2


def multiply_method(num1, num2):
    num1 = Decimal(str(num1))
    num2 = Decimal(str(num2))
    return num1*num2

# 相加add
print(div_method("6.2", 2.1))

# 2.0版本除以 divide

# 2.版本 乘以 multiply

# from decimal import Decimal
# big_decimal = Decimal(order_qty)
# buy_price = Decimal(str(buy_price))
# acture_money = big_decimal.multiply(buy_price)
